<div class="layuimini-main">
    <div class="layui-form layuimini-form">
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">报修描述</label>
            <div class="layui-input-block">
                <textarea name="description" class="layui-textarea" placeholder="请输入报修描述"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['form', 'table','axios','ztree','laydate'], function () {
        let form = layui.form,
            layer = layui.layer,
            ztree = layui.ztree,
            laydate = layui.laydate,
            axios = layui.axios,
            $ = layui.$;


        // 当前弹出层，防止ID被覆盖
        let parentIndex = layer.index;
        //监听提交
        form.on('submit(saveBtn)', function (data) {
            axios.post('stu/repair_create',data.field).then(function(response){
                if(response.code == 200){
                    layer.msg(response.msg);
                    window.reload();
                }
                layer.close(parentIndex);
            }).catch(function (error) {
                layer.msg(error);
            });
            return false;
        });

    });
</script>